﻿using System;
using Sinacor.Infra.Common;
using System.Collections.Generic;
using Sinacor.Servico.Bovespa.Contabil.BusinessEntity;
using Sinacor.Servico.Bovespa.Contabil.Service.DataContract.Request;

namespace Sinacor.Servico.Bovespa.Contabil.Service.ServiceImplementation.Translator.DataContractToBusinessEntity
{
    /// <summary>
    /// FGualberto.7COMm - Task 6312
    /// </summary>
    public class HistoricoContabil
    {
        /// <summary>
        /// Para FiltroHistoricoContabil - Unitário
        /// </summary>
        /// <param name="from">FiltroHistoricoContabilRequest</param>
        /// <returns>FiltroHistoricoContabil</returns>
        public BusinessEntity.Parameter.FiltroHistoricoContabil ToFiltroHistoricoContabil(DataContract.Request.FiltroHistoricoContabilRequest from)
        {
            BusinessEntity.Parameter.FiltroHistoricoContabil to = new BusinessEntity.Parameter.FiltroHistoricoContabil();
            to.Codigo = from.Codigo;
            to.Digito = from.Digito;
            to.Descricao = from.Descricao;
            return to;
        }

        /// <summary>
        /// Para FiltroHistoricoContabil - Coleção
        /// </summary>
        /// <param name="from">FiltroHistoricoContabilRequest</param>
        /// <returns>FiltroHistoricoContabil</returns>
        public List<BusinessEntity.Parameter.FiltroHistoricoContabil> ToFiltroHistoricoContabil(List<DataContract.Request.FiltroHistoricoContabilRequest> requestList)
        {
            List<BusinessEntity.Parameter.FiltroHistoricoContabil> to = new List<BusinessEntity.Parameter.FiltroHistoricoContabil>();
            foreach (DataContract.Request.FiltroHistoricoContabilRequest corr in requestList)
            {
                to.Add(ToFiltroHistoricoContabil(corr));
            }
            return to;

        }
    }
}
